<?php
if (isset($_GET['conf'])) { return; }
elseif (!isset($conf))    { return; }

$z = strtolower(ini_get('zlib.output_compression'));
if(!$z || $z == 'off') 	{ ob_start("ob_gzhandler"); }
else                   	{ ob_start(); }

// debug
if($conf['debug_speed']) { 
	require_once 'speed/_dima_timestat.php'; 
	error_reporting(ini_get('error_reporting'));
}


// includes
require_once 'core/base/BaseApp.php';
require_once 'core/base/BaseView.php';
require_once 'core/base/BaseModel.php';
require_once 'core/app/AppModel.php';
//require_once 'core/app/PageRenderer.php';
require_once 'core/app/AppMsg.php';

require_once 'eleontev/HTML/FormSelect.php';
require_once 'eleontev/HTML/tplTemplatez.php';
require_once 'eleontev/URL/RequestData.php';
require_once 'eleontev/Util/GetMsg.php';
require_once 'eleontev/Assorted.inc.php';
require_once 'eleontev/Auth/AuthPriv.php';
require_once 'eleontev/PageByPage.php';
require_once 'adodb/adodb.inc.php';

require_once APP_MSG_LANG_DIR . 'config_lang.php';
//define('XAJAX_DEFAULT_CHAR_ENCODING', $conf['lang']['meta_charset']); // for xajax


if(file_exists(APP_EXTRA_MODULE_DIR . 'config.inc.php')) {
	require_once APP_EXTRA_MODULE_DIR . 'config.inc.php';
}

// able to run php 5 functions
$func = array('http_build_query', 'stripos');
require_once 'PHP/Compat.php';
PHP_Compat::loadFunction($func);


$client_dir = APP_CLIENT_DIR . 'client/inc/';

require_once $client_dir . 'KBClientLoader.php';
require_once $client_dir . 'KBClientModel.php';
require_once $client_dir . 'KBClientView.php';
require_once $client_dir . 'KBClientController.php';
require_once $client_dir . 'KBClientAction.php';
require_once $client_dir . 'KBClientPageRenderer.php';
require_once $client_dir . 'DocumentParser.php';


$db =& DBUtil::connect($conf);

$reg =& Registry::instance();
$reg->setEntry('db', $db);
$reg->setEntry('tbl_pref', $conf['tbl_pref']);
$reg->setEntry('conf', $conf);
$reg->setEntry('extra', $conf['extra']);
?>